<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilskey: xilskey_bbram_ultrascale_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilskey
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xilskey__bbram__ultrascale__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xilskey_bbram_ultrascale_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p><a class="el" href="xilskey__bbram__ultrascale__example_8c.html" title="xilskey_bbram_ultrascale_example.c ">xilskey_bbram_ultrascale_example.c</a> </p>
<dl class="section note"><dt>Note</dt><dd>Example illustrates the method of programming the AES key to Ultrascale BBRAM. The AES key to be programmed should be mentioned in <a class="el" href="xilskey__bbram__ultrascale__input_8h.html" title="This file contains macros which needs to configured by user based on the options selected by user ope...">xilskey_bbram_ultrascale_input.h</a>. BBRAM is a battery backed RAM and there is no restriction on the number of times key can programmed. This algorithm only works when program and verify key are done together and in that order.</dd></dl>
<p>Accessing Ultrascale microblaze 's BBRAM is done by using block RAM initialization. Master Jtag primitive has to added to design i.e MASTER_JTAG_inst instantiation have to performed and AXI GPIO pins has to be connected to TDO, TDI, TMS and TCK signals of MASTER_JTAG primitive. All Inputs(TDO) and All Outputs(TDI, TMS, TCK) of MASTER_JTAG can be connected as 1) All Inputs to one channel All Outputs to other channel Valid example: All Outputs connected to Channel 1 Input signal TDO also connected to channel 2 2) All Inputs and All Outputs to same channel. Valid example: All Outputs connected to Channel 1 Input signal TDO also connected to channel 1 3) But some of the Outputs in one channel and some of them in different channel is not accepted. Invalid example: All Outputs connected to Channel 1 Input signals (TDI, TMS) connected to Channel 1 Input signal TCK also connected to channel 2</p>
<p>The design should only contain AXI bram Ctrl memory mapped(1MB). Note: MASTER_JTAG will disable all other JTAGs Procedure to access BBRAM of Ultrascale: 1) After providing the required inputs in <a class="el" href="xilskey__bbram__ultrascale__input_8h.html" title="This file contains macros which needs to configured by user based on the options selected by user ope...">xilskey_bbram_ultrascale_input.h</a>, compile the project. 2) Generate a memory mapped interface file using TCL command write_mem_info $Outfilename 3) Update memory has to be done using the tcl command updatemem. updatemem -meminfo $file.mmi -data $Outfilename.elf -bit $design.bit -proc design_1_i/microblaze_0 -out $Final.bit 4) Program the board using $Final.bit bitstream 5) Output can be seen in UART terminal.</p>
<p>MODIFICATION HISTORY:</p>
<p>Ver Who Date Changes </p>
<hr/>
<p> 5.0 vns 09/01/16 First Release. 6.0 vns 07/28/16 Updated example to allow counting configuration feature and to program Obfuscated key. 6.7 psl 03/20/19 Added BBRAM key write support for SSIT devices. psl 03/29/19 Added Support for user configurable GPIO for jtag control. 6.8 psl 05/21/19 Initialized SystemInitDone ,to indicate XilSKey_Bbram_JTAGServerInit status. And passed BbramInstancePtr instead of InstancePtr in XilSKey_Bbram_JTAGServerInit. </p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aa2a34496cba738813e2c992e8d15a260"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__bbram__ultrascale__example_8c.html#aa2a34496cba738813e2c992e8d15a260">XilSKey_Bbram_InitData</a> (XilSKey_Bbram *BbramInstancePtr)</td></tr>
<tr class="memdesc:aa2a34496cba738813e2c992e8d15a260"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to initialize BBRAM instance.  <a href="#aa2a34496cba738813e2c992e8d15a260">More...</a><br/></td></tr>
<tr class="separator:aa2a34496cba738813e2c992e8d15a260"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4084b23203ebac05b1367e2e59f424d1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__bbram__ultrascale__example_8c.html#a4084b23203ebac05b1367e2e59f424d1">XilSKey_Bbram_ProgramSLR</a> (XilSKey_Bbram *BbramInstancePtr)</td></tr>
<tr class="memdesc:a4084b23203ebac05b1367e2e59f424d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to program the key for specific SLR.  <a href="#a4084b23203ebac05b1367e2e59f424d1">More...</a><br/></td></tr>
<tr class="separator:a4084b23203ebac05b1367e2e59f424d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afdb9b1c206a7bc8f6b18653dc3b5e5e1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__bbram__ultrascale__example_8c.html#afdb9b1c206a7bc8f6b18653dc3b5e5e1">Bbram_Close_Ultra</a> (void)</td></tr>
<tr class="memdesc:afdb9b1c206a7bc8f6b18653dc3b5e5e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function close UltraScale.  <a href="#afdb9b1c206a7bc8f6b18653dc3b5e5e1">More...</a><br/></td></tr>
<tr class="separator:afdb9b1c206a7bc8f6b18653dc3b5e5e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__bbram__ultrascale__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="afdb9b1c206a7bc8f6b18653dc3b5e5e1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Bbram_Close_Ultra </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function close UltraScale. </p>
<dl class="section return"><dt>Returns</dt><dd>none</dd></dl>
<dl class="section note"><dt>Note</dt><dd>none </dd></dl>

<p>References <a class="el" href="xilskey__jscmd_8c.html#a50f568193dfe2570ed49e4e368725e2b">calcInstr()</a>, <a class="el" href="xilskey__jscmd_8c.html#a78af9b51ba9fcca1fee4e43816ccf78f">jtag_navigate()</a>, <a class="el" href="xilskey__jscmd_8c.html#a7464db2af53dd1a43ebc36827189cb52">jtag_shift()</a>, <a class="el" href="xilskey__jscmd_8c.html#a3222cb7373329b7e49fb631629e297d4">setPin()</a>, and <a class="el" href="xilskey__bbram_8c.html#ad332b969fb28da07cb32106cb4fbebf4">XilSKeyJtag</a>.</p>

<p>Referenced by <a class="el" href="xilskey__bbram__ultrascale__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
<a class="anchor" id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Verify the SLR requested to program against target validity</p>

<p>References <a class="el" href="xilskey__jscmd_8c.html#afdb9b1c206a7bc8f6b18653dc3b5e5e1">Bbram_Close_Ultra()</a>, <a class="el" href="xilskey__bbram__example_8c.html#aa2a34496cba738813e2c992e8d15a260">XilSKey_Bbram_InitData()</a>, <a class="el" href="xilskey__bbram__ultrascale__example_8c.html#a4084b23203ebac05b1367e2e59f424d1">XilSKey_Bbram_ProgramSLR()</a>, <a class="el" href="xilskey__utils_8c.html#a65f56a1dfb7f9691f8e5d917057e500d">XilSKey_Efuse_ConvertStringToHexLE()</a>, <a class="el" href="xilskey__bbram__ultrascale__input_8h.html#ad7051b5ff22bacaeb91d3f0f0b81b861">XSK_BBRAM_OBFUSCATED_KEY_SLR_CONFIG_ORDER_0</a>, <a class="el" href="xilskey__bbram__ultrascale__input_8h.html#a33abdcfb449aff3bd99ebfe4167805b5">XSK_BBRAM_PGM_AES_KEY_SLR_CONFIG_ORDER_0</a>, <a class="el" href="xilskey__bbram__ultrascale__input_8h.html#afcb4c08aaf1357459a0bab50ec1c0969">XSK_BBRAM_PGM_AES_KEY_SLR_CONFIG_ORDER_1</a>, <a class="el" href="xilskey__bbram__ultrascale__input_8h.html#a509ab1e3b0950cf8b1fa39047c536ac4">XSK_BBRAM_PGM_AES_KEY_SLR_CONFIG_ORDER_2</a>, <a class="el" href="xilskey__bbram__ultrascale__input_8h.html#a87aa0c2ce592abc84a1e05b0d6c14205">XSK_BBRAM_PGM_AES_KEY_SLR_CONFIG_ORDER_3</a>, <a class="el" href="xilskey__bbram__ultrascale__input_8h.html#ab51b32965cd87ce17c02b68dd50016da">XSK_BBRAM_PGM_OBFUSCATED_KEY_SLR_CONFIG_ORDER_0</a>, <a class="el" href="xilskey__bbram__ultrascale__input_8h.html#a0bb8e937f8c6eb96ecc4b1cfc0055029">XSK_BBRAM_PGM_OBFUSCATED_KEY_SLR_CONFIG_ORDER_1</a>, <a class="el" href="xilskey__bbram__ultrascale__input_8h.html#aaca7038d7ac493408e7d8eabc7bcc885">XSK_BBRAM_PGM_OBFUSCATED_KEY_SLR_CONFIG_ORDER_2</a>, and <a class="el" href="xilskey__bbram__ultrascale__input_8h.html#a55b4bf8197a3ce4ba6dd59a1b30c1fd0">XSK_BBRAM_PGM_OBFUSCATED_KEY_SLR_CONFIG_ORDER_3</a>.</p>

</div>
</div>
<a class="anchor" id="aa2a34496cba738813e2c992e8d15a260"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilSKey_Bbram_InitData </td>
          <td>(</td>
          <td class="paramtype">XilSKey_Bbram *&#160;</td>
          <td class="paramname"><em>BbramInstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to initialize BBRAM instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BBRAM</td><td>instance pointer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS - In case of Success</li>
</ul>
</dd></dl>
<ul>
<li>XST_FAILURE - If initialization fails</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a class="anchor" id="a4084b23203ebac05b1367e2e59f424d1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilSKey_Bbram_ProgramSLR </td>
          <td>(</td>
          <td class="paramtype">XilSKey_Bbram *&#160;</td>
          <td class="paramname"><em>BbramInstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to program the key for specific SLR. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">SLR</td><td>number</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS - In case of Success</li>
</ul>
</dd></dl>
<ul>
<li>XST_FAILURE - If initialization fails</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="group__xilskey__zynq__ultra__bbram.html#gac7bc27c2933ca2ed403fb3487beee6f8">XilSKey_Bbram_Program()</a>.</p>

<p>Referenced by <a class="el" href="xilskey__bbram__ultrascale__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
